home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_yerbisma.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  113 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Yerbita.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16. message    user0
  17.  
  18. cog        talkCog                    local
  19.  
  20. sound    foundSnd=INXJ156.wav    local
  21.  
  22. thing    player                    local
  23.  
  24. int        bin=38                    local
  25. int        health=1000                local
  26.  
  27. end
  28.  
  29. # ===================================================================
  30.  
  31. code
  32.  
  33. activated:
  34.  
  35.     StartCutscene(0);
  36.  
  37.     talkCog = GetCogByIndex(0);
  38.     SendMessage(talkCog, 27);
  39.  
  40.     if (Rand() < 0.5)
  41.     {
  42.         SetExtCamOffset('0.15 -0.05 0.04');
  43.     }
  44.     else
  45.     {
  46.         SetExtCamOffset('-0.15 -0.05 0.04');
  47.     }
  48.     SetExtCamLookOffset('0.0 0.02 -0.01');
  49.  
  50.     return;
  51.  
  52. # -------------------------------------------------------------------
  53.  
  54. touched:
  55.  
  56.     player = GetSourceRef();
  57.  
  58.     if (GetInv(player, bin) < GetInvMax(player, bin))
  59.     {
  60.         TakeItem(GetSenderRef(), player);
  61.     }
  62.     else
  63.     {
  64.         EndCutscene();
  65.     }
  66.     
  67.     return;
  68.  
  69. # -------------------------------------------------------------------
  70.  
  71. taken:
  72.  
  73.     player = GetSourceRef();
  74.  
  75.     ChangeInv(player, bin, 1.0);
  76.     SetInvAvailable(player, bin, 1);
  77.     JonesInvItemChanged(bin);
  78.  
  79.     Sleep(1.0);
  80.     PlayVoice(player, foundSnd, 1.0, 0);
  81.  
  82.     EndCutscene();
  83.  
  84.     return;
  85.  
  86. # -------------------------------------------------------------------
  87.  
  88. user0:
  89.  
  90.     player = GetLocalPlayerThing();
  91.  
  92.     if (GetInv(player, bin) > 0)
  93.     {
  94.         if (GetHealth(player) < 1000)
  95.         {
  96.             # Clear the poisoned bit just in case
  97.             ClearActorFlags(player, 0x2000);
  98.  
  99.             # Use the health kit
  100.             HealThing(player, health);
  101.             ChangeInv(player, bin, -1);
  102.             
  103.             if (GetInv(player, bin) == 0)
  104.             {
  105.                 SetInvAvailable(player, bin, 0);
  106.             }
  107.         }
  108.     }
  109.     
  110.     return;
  111.  
  112. end
  113.